#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)]
#![allow(unused_imports, unused_attributes)]
#![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names, clippy::too_many_arguments)]

use async_trait::async_trait;
use futures::Stream;
use std::error::Error;
use std::task::{Poll, Context};
use swagger::{ApiError, ContextWrapper};
use serde::{Serialize, Deserialize};

type ServiceError = Box<dyn Error + Send + Sync + 'static>;

pub const BASE_PATH: &str = "";
pub const API_VERSION: &str = "0.1.21";

#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub enum HelloGetResponse {
    /// 成功
    Status200
    {
        body: String,
        access_control_allow_origin:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
pub enum ProjectGetResponse {
    /// 成功
    Status200
    {
        body: Vec<models::ProjectInfo>,
        access_control_allow_origin:
        Option<
        String
        >
    }
    ,
    /// 失败
    Status500
    {
        body: models::ErrInfo,
        access_control_allow_origin:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
pub enum ShowGetResponse {
    /// 成功
    Status200
    {
        body: serde_json::Value,
        access_control_allow_origin:
        Option<
        String
        >
    }
    ,
    /// 失败
    Status500
    {
        body: models::ErrInfo,
        access_control_allow_origin:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
pub enum MinappGetResponse {
    /// 成功
    Status200
    {
        body: Vec<models::MinappInfo>,
        access_control_allow_origin:
        Option<
        String
        >
    }
    ,
    /// 失败
    Status500
    {
        body: models::ErrInfo,
        access_control_allow_origin:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
pub enum MinappMinappIdGetResponse {
    /// 成功
    Status200
    {
        body: serde_json::Value,
        access_control_allow_origin:
        Option<
        String
        >
    }
    ,
    /// 失败
    Status500
    {
        body: models::ErrInfo,
        access_control_allow_origin:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
pub enum ProjectProjectIdBugAllGetResponse {
    /// 成功
    Status200
    {
        body: models::ProjectProjectIdBugAllGet200Response,
        access_control_allow_origin:
        Option<
        String
        >
    }
    ,
    /// 失败
    Status500
    {
        body: models::ErrInfo,
        access_control_allow_origin:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
pub enum ProjectProjectIdBugMyGetResponse {
    /// 成功
    Status200
    {
        body: Vec<models::BugInfo>,
        access_control_allow_origin:
        Option<
        String
        >
    }
    ,
    /// 失败
    Status500
    {
        body: models::ErrInfo,
        access_control_allow_origin:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
pub enum ProjectProjectIdBugRecordBugIdEventsGetResponse {
    /// 成功
    Status200
    {
        body: Vec<models::EventInfo>,
        access_control_allow_origin:
        Option<
        String
        >
    }
    ,
    /// 失败
    Status500
    {
        body: models::ErrInfo,
        access_control_allow_origin:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
pub enum ProjectProjectIdBugRecordBugIdShortNoteGetResponse {
    /// 成功
    Status200
    {
        body: serde_json::Value,
        access_control_allow_origin:
        Option<
        String
        >
    }
    ,
    /// 失败
    Status500
    {
        body: models::ErrInfo,
        access_control_allow_origin:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
pub enum ProjectProjectIdBugRecordBugIdShowGetResponse {
    /// 成功
    Status200
    {
        body: serde_json::Value,
        access_control_allow_origin:
        Option<
        String
        >
    }
    ,
    /// 失败
    Status500
    {
        body: models::ErrInfo,
        access_control_allow_origin:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
pub enum ProjectProjectIdCodeCommentCommentThreadIdCommentIdDeleteResponse {
    /// 成功
    Status200
    {
        body: serde_json::Value,
        access_control_allow_origin:
        Option<
        String
        >
    }
    ,
    /// 失败
    Status500
    {
        body: models::ErrInfo,
        access_control_allow_origin:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
pub enum ProjectProjectIdCodeCommentCommentThreadIdCommentIdGetResponse {
    /// 成功
    Status200
    {
        body: models::CodeCommentInfo,
        access_control_allow_origin:
        Option<
        String
        >
    }
    ,
    /// 失败
    Status500
    {
        body: models::ErrInfo,
        access_control_allow_origin:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub enum ProjectProjectIdCodeCommentCommentThreadIdCommentIdOptionsResponse {
    /// 成功
    Status200
    {
        body: serde_json::Value,
        access_control_allow_origin:
        Option<
        String
        >
        ,
        access_control_allow_methods:
        Option<
        String
        >
        ,
        access_control_allow_headers:
        Option<
        String
        >
        ,
        access_control_allow_credentials:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
pub enum ProjectProjectIdCodeCommentCommentThreadIdCommentIdPostResponse {
    /// 成功
    Status200
    {
        body: serde_json::Value,
        access_control_allow_origin:
        Option<
        String
        >
    }
    ,
    /// 失败
    Status500
    {
        body: models::ErrInfo,
        access_control_allow_origin:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
pub enum ProjectProjectIdCodeCommentCommentThreadIdGetResponse {
    /// 成功
    Status200
    {
        body: Vec<models::CodeCommentInfo>,
        access_control_allow_origin:
        Option<
        String
        >
    }
    ,
    /// 失败
    Status500
    {
        body: models::ErrInfo,
        access_control_allow_origin:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub enum ProjectProjectIdCodeCommentCommentThreadIdOptionsResponse {
    /// 成功
    Status200
    {
        body: serde_json::Value,
        access_control_allow_origin:
        Option<
        String
        >
        ,
        access_control_allow_methods:
        Option<
        String
        >
        ,
        access_control_allow_headers:
        Option<
        String
        >
        ,
        access_control_allow_credentials:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
pub enum ProjectProjectIdCodeCommentCommentThreadIdPutResponse {
    /// 成功
    Status200
    {
        body: models::ProjectProjectIdCodeCommentCommentThreadIdPut200Response,
        access_control_allow_origin:
        Option<
        String
        >
    }
    ,
    /// 失败
    Status500
    {
        body: models::ErrInfo,
        access_control_allow_origin:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
pub enum ProjectProjectIdEntryFolderIdGetResponse {
    /// 成功
    Status200
    {
        body: Vec<models::EntryInfo>,
        access_control_allow_origin:
        Option<
        String
        >
    }
    ,
    /// 失败
    Status500
    {
        body: models::ErrInfo,
        access_control_allow_origin:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
pub enum ProjectProjectIdEntryShowEntryIdGetResponse {
    /// 成功
    Status200
    {
        body: serde_json::Value,
        access_control_allow_origin:
        Option<
        String
        >
    }
    ,
    /// 失败
    Status500
    {
        body: models::ErrInfo,
        access_control_allow_origin:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
pub enum ProjectProjectIdEventGetResponse {
    /// 成功
    Status200
    {
        body: models::ProjectProjectIdEventGet200Response,
        access_control_allow_origin:
        Option<
        String
        >
    }
    ,
    /// 失败
    Status500
    {
        body: models::ErrInfo,
        access_control_allow_origin:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub enum ProjectProjectIdEventOptionsResponse {
    /// 成功
    Status200
    {
        body: serde_json::Value,
        access_control_allow_origin:
        Option<
        String
        >
        ,
        access_control_allow_methods:
        Option<
        String
        >
        ,
        access_control_allow_headers:
        Option<
        String
        >
        ,
        access_control_allow_credentials:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
pub enum ProjectProjectIdEventPostResponse {
    /// 成功
    Status200
    {
        body: serde_json::Value,
        access_control_allow_origin:
        Option<
        String
        >
    }
    ,
    /// 失败
    Status500
    {
        body: models::ErrInfo,
        access_control_allow_origin:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
pub enum ProjectProjectIdTaskAllGetResponse {
    /// 成功
    Status200
    {
        body: models::ProjectProjectIdTaskAllGet200Response,
        access_control_allow_origin:
        Option<
        String
        >
    }
    ,
    /// 失败
    Status500
    {
        body: models::ErrInfo,
        access_control_allow_origin:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
pub enum ProjectProjectIdTaskMyGetResponse {
    /// 成功
    Status200
    {
        body: Vec<models::TaskInfo>,
        access_control_allow_origin:
        Option<
        String
        >
    }
    ,
    /// 失败
    Status500
    {
        body: models::ErrInfo,
        access_control_allow_origin:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
pub enum ProjectProjectIdTaskRecordTaskIdDependGetResponse {
    /// 成功
    Status200
    {
        body: models::ProjectProjectIdTaskRecordTaskIdDependGet200Response,
        access_control_allow_origin:
        Option<
        String
        >
    }
    ,
    /// 失败
    Status500
    {
        body: models::ErrInfo,
        access_control_allow_origin:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
pub enum ProjectProjectIdTaskRecordTaskIdEventsGetResponse {
    /// 成功
    Status200
    {
        body: Vec<models::EventInfo>,
        access_control_allow_origin:
        Option<
        String
        >
    }
    ,
    /// 失败
    Status500
    {
        body: models::ErrInfo,
        access_control_allow_origin:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
pub enum ProjectProjectIdTaskRecordTaskIdShortNoteGetResponse {
    /// 成功
    Status200
    {
        body: serde_json::Value,
        access_control_allow_origin:
        Option<
        String
        >
    }
    ,
    /// 失败
    Status500
    {
        body: models::ErrInfo,
        access_control_allow_origin:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
pub enum ProjectProjectIdTaskRecordTaskIdShowGetResponse {
    /// 成功
    Status200
    {
        body: serde_json::Value,
        access_control_allow_origin:
        Option<
        String
        >
    }
    ,
    /// 失败
    Status500
    {
        body: models::ErrInfo,
        access_control_allow_origin:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
pub enum ProjectProjectIdTaskRecordTaskIdSubTaskGetResponse {
    /// 成功
    Status200
    {
        body: Vec<models::SubTaskInfo>,
        access_control_allow_origin:
        Option<
        String
        >
    }
    ,
    /// 失败
    Status500
    {
        body: models::ErrInfo,
        access_control_allow_origin:
        Option<
        String
        >
    }
}

#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[must_use]
pub enum ProjectProjectIdToolsPostHookGetResponse {
    /// 成功
    Status200
    {
        body: serde_json::Value,
        access_control_allow_origin:
        Option<
        String
        >
    }
    ,
    /// 失败
    Status500
    {
        body: models::ErrInfo,
        access_control_allow_origin:
        Option<
        String
        >
    }
}

/// API
#[async_trait]
#[allow(clippy::too_many_arguments, clippy::ptr_arg)]
pub trait Api<C: Send + Sync> {
    fn poll_ready(&self, _cx: &mut Context) -> Poll<Result<(), Box<dyn Error + Send + Sync + 'static>>> {
        Poll::Ready(Ok(()))
    }

    /// 握手协议
    async fn hello_get(
        &self,
        access_token: String,
        context: &C) -> Result<HelloGetResponse, ApiError>;

    /// 获取项目列表
    async fn project_get(
        &self,
        access_token: String,
        context: &C) -> Result<ProjectGetResponse, ApiError>;

    /// 显示软件桌面
    async fn show_get(
        &self,
        access_token: String,
        context: &C) -> Result<ShowGetResponse, ApiError>;

    /// 列出微应用
    async fn minapp_get(
        &self,
        access_token: String,
        context: &C) -> Result<MinappGetResponse, ApiError>;

    /// 显示微应用
    async fn minapp_minapp_id_get(
        &self,
        minapp_id: String,
        access_token: String,
        context: &C) -> Result<MinappMinappIdGetResponse, ApiError>;

    /// 所有缺陷
    async fn project_project_id_bug_all_get(
        &self,
        project_id: String,
        offset: i32,
        limit: i32,
        access_token: String,
        context: &C) -> Result<ProjectProjectIdBugAllGetResponse, ApiError>;

    /// 指派给我的缺陷
    async fn project_project_id_bug_my_get(
        &self,
        project_id: String,
        access_token: String,
        state: String,
        context: &C) -> Result<ProjectProjectIdBugMyGetResponse, ApiError>;

    /// 缺陷相关事件
    async fn project_project_id_bug_record_bug_id_events_get(
        &self,
        project_id: String,
        bug_id: String,
        access_token: String,
        context: &C) -> Result<ProjectProjectIdBugRecordBugIdEventsGetResponse, ApiError>;

    /// 便签方式显示缺陷
    async fn project_project_id_bug_record_bug_id_short_note_get(
        &self,
        project_id: String,
        bug_id: String,
        access_token: String,
        context: &C) -> Result<ProjectProjectIdBugRecordBugIdShortNoteGetResponse, ApiError>;

    /// 显示缺陷
    async fn project_project_id_bug_record_bug_id_show_get(
        &self,
        project_id: String,
        bug_id: String,
        access_token: String,
        context: &C) -> Result<ProjectProjectIdBugRecordBugIdShowGetResponse, ApiError>;

    /// 删除代码评论
    async fn project_project_id_code_comment_comment_thread_id_comment_id_delete(
        &self,
        project_id: String,
        comment_thread_id: String,
        comment_id: String,
        access_token: String,
        context: &C) -> Result<ProjectProjectIdCodeCommentCommentThreadIdCommentIdDeleteResponse, ApiError>;

    /// 获取单个代码评论
    async fn project_project_id_code_comment_comment_thread_id_comment_id_get(
        &self,
        project_id: String,
        comment_thread_id: String,
        comment_id: String,
        access_token: String,
        context: &C) -> Result<ProjectProjectIdCodeCommentCommentThreadIdCommentIdGetResponse, ApiError>;

    /// cors helper
    async fn project_project_id_code_comment_comment_thread_id_comment_id_options(
        &self,
        project_id: String,
        comment_thread_id: String,
        comment_id: String,
        access_token: String,
        context: &C) -> Result<ProjectProjectIdCodeCommentCommentThreadIdCommentIdOptionsResponse, ApiError>;

    /// 更新单个代码评论
    async fn project_project_id_code_comment_comment_thread_id_comment_id_post(
        &self,
        project_id: String,
        comment_thread_id: String,
        comment_id: String,
        access_token: String,
        project_project_id_code_comment_comment_thread_id_put_request: Option<models::ProjectProjectIdCodeCommentCommentThreadIdPutRequest>,
        context: &C) -> Result<ProjectProjectIdCodeCommentCommentThreadIdCommentIdPostResponse, ApiError>;

    /// 列出代码评论
    async fn project_project_id_code_comment_comment_thread_id_get(
        &self,
        project_id: String,
        comment_thread_id: String,
        access_token: String,
        context: &C) -> Result<ProjectProjectIdCodeCommentCommentThreadIdGetResponse, ApiError>;

    /// cors helper
    async fn project_project_id_code_comment_comment_thread_id_options(
        &self,
        project_id: String,
        comment_thread_id: String,
        access_token: String,
        context: &C) -> Result<ProjectProjectIdCodeCommentCommentThreadIdOptionsResponse, ApiError>;

    /// 新增代码评论
    async fn project_project_id_code_comment_comment_thread_id_put(
        &self,
        project_id: String,
        comment_thread_id: String,
        access_token: String,
        project_project_id_code_comment_comment_thread_id_put_request: Option<models::ProjectProjectIdCodeCommentCommentThreadIdPutRequest>,
        context: &C) -> Result<ProjectProjectIdCodeCommentCommentThreadIdPutResponse, ApiError>;

    /// 列出内容目录和入口
    async fn project_project_id_entry_folder_id_get(
        &self,
        project_id: String,
        folder_id: String,
        access_token: String,
        context: &C) -> Result<ProjectProjectIdEntryFolderIdGetResponse, ApiError>;

    /// 打开内容入口
    async fn project_project_id_entry_show_entry_id_get(
        &self,
        project_id: String,
        entry_id: String,
        access_token: String,
        context: &C) -> Result<ProjectProjectIdEntryShowEntryIdGetResponse, ApiError>;

    /// 事件列表
    async fn project_project_id_event_get(
        &self,
        project_id: String,
        from_time: i64,
        to_time: i64,
        offset: i32,
        limit: i32,
        access_token: String,
        user_id: Option<String>,
        context: &C) -> Result<ProjectProjectIdEventGetResponse, ApiError>;

    /// cors helper
    async fn project_project_id_event_options(
        &self,
        project_id: String,
        access_token: String,
        context: &C) -> Result<ProjectProjectIdEventOptionsResponse, ApiError>;

    /// 上报自定义事件
    async fn project_project_id_event_post(
        &self,
        project_id: String,
        access_token: String,
        project_project_id_event_post_request: Option<models::ProjectProjectIdEventPostRequest>,
        context: &C) -> Result<ProjectProjectIdEventPostResponse, ApiError>;

    /// 所有任务
    async fn project_project_id_task_all_get(
        &self,
        project_id: String,
        offset: i32,
        limit: i32,
        access_token: String,
        context: &C) -> Result<ProjectProjectIdTaskAllGetResponse, ApiError>;

    /// 指派给我的任务
    async fn project_project_id_task_my_get(
        &self,
        project_id: String,
        state: String,
        access_token: String,
        context: &C) -> Result<ProjectProjectIdTaskMyGetResponse, ApiError>;

    /// 列出依赖工单
    async fn project_project_id_task_record_task_id_depend_get(
        &self,
        project_id: String,
        task_id: String,
        access_token: String,
        context: &C) -> Result<ProjectProjectIdTaskRecordTaskIdDependGetResponse, ApiError>;

    /// 任务相关事件
    async fn project_project_id_task_record_task_id_events_get(
        &self,
        project_id: String,
        task_id: String,
        access_token: String,
        context: &C) -> Result<ProjectProjectIdTaskRecordTaskIdEventsGetResponse, ApiError>;

    /// 便签方式显示任务
    async fn project_project_id_task_record_task_id_short_note_get(
        &self,
        project_id: String,
        task_id: String,
        access_token: String,
        context: &C) -> Result<ProjectProjectIdTaskRecordTaskIdShortNoteGetResponse, ApiError>;

    /// 显示任务
    async fn project_project_id_task_record_task_id_show_get(
        &self,
        project_id: String,
        task_id: String,
        access_token: String,
        context: &C) -> Result<ProjectProjectIdTaskRecordTaskIdShowGetResponse, ApiError>;

    /// 列出子任务
    async fn project_project_id_task_record_task_id_sub_task_get(
        &self,
        project_id: String,
        task_id: String,
        access_token: String,
        context: &C) -> Result<ProjectProjectIdTaskRecordTaskIdSubTaskGetResponse, ApiError>;

    /// git post commit hook回调
    async fn project_project_id_tools_post_hook_get(
        &self,
        project_id: String,
        access_token: String,
        context: &C) -> Result<ProjectProjectIdToolsPostHookGetResponse, ApiError>;

}

/// API where `Context` isn't passed on every API call
#[async_trait]
#[allow(clippy::too_many_arguments, clippy::ptr_arg)]
pub trait ApiNoContext<C: Send + Sync> {

    fn poll_ready(&self, _cx: &mut Context) -> Poll<Result<(), Box<dyn Error + Send + Sync + 'static>>>;

    fn context(&self) -> &C;

    /// 握手协议
    async fn hello_get(
        &self,
        access_token: String,
        ) -> Result<HelloGetResponse, ApiError>;

    /// 获取项目列表
    async fn project_get(
        &self,
        access_token: String,
        ) -> Result<ProjectGetResponse, ApiError>;

    /// 显示软件桌面
    async fn show_get(
        &self,
        access_token: String,
        ) -> Result<ShowGetResponse, ApiError>;

    /// 列出微应用
    async fn minapp_get(
        &self,
        access_token: String,
        ) -> Result<MinappGetResponse, ApiError>;

    /// 显示微应用
    async fn minapp_minapp_id_get(
        &self,
        minapp_id: String,
        access_token: String,
        ) -> Result<MinappMinappIdGetResponse, ApiError>;

    /// 所有缺陷
    async fn project_project_id_bug_all_get(
        &self,
        project_id: String,
        offset: i32,
        limit: i32,
        access_token: String,
        ) -> Result<ProjectProjectIdBugAllGetResponse, ApiError>;

    /// 指派给我的缺陷
    async fn project_project_id_bug_my_get(
        &self,
        project_id: String,
        access_token: String,
        state: String,
        ) -> Result<ProjectProjectIdBugMyGetResponse, ApiError>;

    /// 缺陷相关事件
    async fn project_project_id_bug_record_bug_id_events_get(
        &self,
        project_id: String,
        bug_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdBugRecordBugIdEventsGetResponse, ApiError>;

    /// 便签方式显示缺陷
    async fn project_project_id_bug_record_bug_id_short_note_get(
        &self,
        project_id: String,
        bug_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdBugRecordBugIdShortNoteGetResponse, ApiError>;

    /// 显示缺陷
    async fn project_project_id_bug_record_bug_id_show_get(
        &self,
        project_id: String,
        bug_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdBugRecordBugIdShowGetResponse, ApiError>;

    /// 删除代码评论
    async fn project_project_id_code_comment_comment_thread_id_comment_id_delete(
        &self,
        project_id: String,
        comment_thread_id: String,
        comment_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdCodeCommentCommentThreadIdCommentIdDeleteResponse, ApiError>;

    /// 获取单个代码评论
    async fn project_project_id_code_comment_comment_thread_id_comment_id_get(
        &self,
        project_id: String,
        comment_thread_id: String,
        comment_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdCodeCommentCommentThreadIdCommentIdGetResponse, ApiError>;

    /// cors helper
    async fn project_project_id_code_comment_comment_thread_id_comment_id_options(
        &self,
        project_id: String,
        comment_thread_id: String,
        comment_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdCodeCommentCommentThreadIdCommentIdOptionsResponse, ApiError>;

    /// 更新单个代码评论
    async fn project_project_id_code_comment_comment_thread_id_comment_id_post(
        &self,
        project_id: String,
        comment_thread_id: String,
        comment_id: String,
        access_token: String,
        project_project_id_code_comment_comment_thread_id_put_request: Option<models::ProjectProjectIdCodeCommentCommentThreadIdPutRequest>,
        ) -> Result<ProjectProjectIdCodeCommentCommentThreadIdCommentIdPostResponse, ApiError>;

    /// 列出代码评论
    async fn project_project_id_code_comment_comment_thread_id_get(
        &self,
        project_id: String,
        comment_thread_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdCodeCommentCommentThreadIdGetResponse, ApiError>;

    /// cors helper
    async fn project_project_id_code_comment_comment_thread_id_options(
        &self,
        project_id: String,
        comment_thread_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdCodeCommentCommentThreadIdOptionsResponse, ApiError>;

    /// 新增代码评论
    async fn project_project_id_code_comment_comment_thread_id_put(
        &self,
        project_id: String,
        comment_thread_id: String,
        access_token: String,
        project_project_id_code_comment_comment_thread_id_put_request: Option<models::ProjectProjectIdCodeCommentCommentThreadIdPutRequest>,
        ) -> Result<ProjectProjectIdCodeCommentCommentThreadIdPutResponse, ApiError>;

    /// 列出内容目录和入口
    async fn project_project_id_entry_folder_id_get(
        &self,
        project_id: String,
        folder_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdEntryFolderIdGetResponse, ApiError>;

    /// 打开内容入口
    async fn project_project_id_entry_show_entry_id_get(
        &self,
        project_id: String,
        entry_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdEntryShowEntryIdGetResponse, ApiError>;

    /// 事件列表
    async fn project_project_id_event_get(
        &self,
        project_id: String,
        from_time: i64,
        to_time: i64,
        offset: i32,
        limit: i32,
        access_token: String,
        user_id: Option<String>,
        ) -> Result<ProjectProjectIdEventGetResponse, ApiError>;

    /// cors helper
    async fn project_project_id_event_options(
        &self,
        project_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdEventOptionsResponse, ApiError>;

    /// 上报自定义事件
    async fn project_project_id_event_post(
        &self,
        project_id: String,
        access_token: String,
        project_project_id_event_post_request: Option<models::ProjectProjectIdEventPostRequest>,
        ) -> Result<ProjectProjectIdEventPostResponse, ApiError>;

    /// 所有任务
    async fn project_project_id_task_all_get(
        &self,
        project_id: String,
        offset: i32,
        limit: i32,
        access_token: String,
        ) -> Result<ProjectProjectIdTaskAllGetResponse, ApiError>;

    /// 指派给我的任务
    async fn project_project_id_task_my_get(
        &self,
        project_id: String,
        state: String,
        access_token: String,
        ) -> Result<ProjectProjectIdTaskMyGetResponse, ApiError>;

    /// 列出依赖工单
    async fn project_project_id_task_record_task_id_depend_get(
        &self,
        project_id: String,
        task_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdTaskRecordTaskIdDependGetResponse, ApiError>;

    /// 任务相关事件
    async fn project_project_id_task_record_task_id_events_get(
        &self,
        project_id: String,
        task_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdTaskRecordTaskIdEventsGetResponse, ApiError>;

    /// 便签方式显示任务
    async fn project_project_id_task_record_task_id_short_note_get(
        &self,
        project_id: String,
        task_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdTaskRecordTaskIdShortNoteGetResponse, ApiError>;

    /// 显示任务
    async fn project_project_id_task_record_task_id_show_get(
        &self,
        project_id: String,
        task_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdTaskRecordTaskIdShowGetResponse, ApiError>;

    /// 列出子任务
    async fn project_project_id_task_record_task_id_sub_task_get(
        &self,
        project_id: String,
        task_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdTaskRecordTaskIdSubTaskGetResponse, ApiError>;

    /// git post commit hook回调
    async fn project_project_id_tools_post_hook_get(
        &self,
        project_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdToolsPostHookGetResponse, ApiError>;

}

/// Trait to extend an API to make it easy to bind it to a context.
pub trait ContextWrapperExt<C: Send + Sync> where Self: Sized
{
    /// Binds this API to a context.
    fn with_context(self, context: C) -> ContextWrapper<Self, C>;
}

impl<T: Api<C> + Send + Sync, C: Clone + Send + Sync> ContextWrapperExt<C> for T {
    fn with_context(self: T, context: C) -> ContextWrapper<T, C> {
         ContextWrapper::<T, C>::new(self, context)
    }
}

#[async_trait]
impl<T: Api<C> + Send + Sync, C: Clone + Send + Sync> ApiNoContext<C> for ContextWrapper<T, C> {
    fn poll_ready(&self, cx: &mut Context) -> Poll<Result<(), ServiceError>> {
        self.api().poll_ready(cx)
    }

    fn context(&self) -> &C {
        ContextWrapper::context(self)
    }

    /// 握手协议
    async fn hello_get(
        &self,
        access_token: String,
        ) -> Result<HelloGetResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().hello_get(access_token, &context).await
    }

    /// 获取项目列表
    async fn project_get(
        &self,
        access_token: String,
        ) -> Result<ProjectGetResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().project_get(access_token, &context).await
    }

    /// 显示软件桌面
    async fn show_get(
        &self,
        access_token: String,
        ) -> Result<ShowGetResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().show_get(access_token, &context).await
    }

    /// 列出微应用
    async fn minapp_get(
        &self,
        access_token: String,
        ) -> Result<MinappGetResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().minapp_get(access_token, &context).await
    }

    /// 显示微应用
    async fn minapp_minapp_id_get(
        &self,
        minapp_id: String,
        access_token: String,
        ) -> Result<MinappMinappIdGetResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().minapp_minapp_id_get(minapp_id, access_token, &context).await
    }

    /// 所有缺陷
    async fn project_project_id_bug_all_get(
        &self,
        project_id: String,
        offset: i32,
        limit: i32,
        access_token: String,
        ) -> Result<ProjectProjectIdBugAllGetResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().project_project_id_bug_all_get(project_id, offset, limit, access_token, &context).await
    }

    /// 指派给我的缺陷
    async fn project_project_id_bug_my_get(
        &self,
        project_id: String,
        access_token: String,
        state: String,
        ) -> Result<ProjectProjectIdBugMyGetResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().project_project_id_bug_my_get(project_id, access_token, state, &context).await
    }

    /// 缺陷相关事件
    async fn project_project_id_bug_record_bug_id_events_get(
        &self,
        project_id: String,
        bug_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdBugRecordBugIdEventsGetResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().project_project_id_bug_record_bug_id_events_get(project_id, bug_id, access_token, &context).await
    }

    /// 便签方式显示缺陷
    async fn project_project_id_bug_record_bug_id_short_note_get(
        &self,
        project_id: String,
        bug_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdBugRecordBugIdShortNoteGetResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().project_project_id_bug_record_bug_id_short_note_get(project_id, bug_id, access_token, &context).await
    }

    /// 显示缺陷
    async fn project_project_id_bug_record_bug_id_show_get(
        &self,
        project_id: String,
        bug_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdBugRecordBugIdShowGetResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().project_project_id_bug_record_bug_id_show_get(project_id, bug_id, access_token, &context).await
    }

    /// 删除代码评论
    async fn project_project_id_code_comment_comment_thread_id_comment_id_delete(
        &self,
        project_id: String,
        comment_thread_id: String,
        comment_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdCodeCommentCommentThreadIdCommentIdDeleteResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().project_project_id_code_comment_comment_thread_id_comment_id_delete(project_id, comment_thread_id, comment_id, access_token, &context).await
    }

    /// 获取单个代码评论
    async fn project_project_id_code_comment_comment_thread_id_comment_id_get(
        &self,
        project_id: String,
        comment_thread_id: String,
        comment_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdCodeCommentCommentThreadIdCommentIdGetResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().project_project_id_code_comment_comment_thread_id_comment_id_get(project_id, comment_thread_id, comment_id, access_token, &context).await
    }

    /// cors helper
    async fn project_project_id_code_comment_comment_thread_id_comment_id_options(
        &self,
        project_id: String,
        comment_thread_id: String,
        comment_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdCodeCommentCommentThreadIdCommentIdOptionsResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().project_project_id_code_comment_comment_thread_id_comment_id_options(project_id, comment_thread_id, comment_id, access_token, &context).await
    }

    /// 更新单个代码评论
    async fn project_project_id_code_comment_comment_thread_id_comment_id_post(
        &self,
        project_id: String,
        comment_thread_id: String,
        comment_id: String,
        access_token: String,
        project_project_id_code_comment_comment_thread_id_put_request: Option<models::ProjectProjectIdCodeCommentCommentThreadIdPutRequest>,
        ) -> Result<ProjectProjectIdCodeCommentCommentThreadIdCommentIdPostResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().project_project_id_code_comment_comment_thread_id_comment_id_post(project_id, comment_thread_id, comment_id, access_token, project_project_id_code_comment_comment_thread_id_put_request, &context).await
    }

    /// 列出代码评论
    async fn project_project_id_code_comment_comment_thread_id_get(
        &self,
        project_id: String,
        comment_thread_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdCodeCommentCommentThreadIdGetResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().project_project_id_code_comment_comment_thread_id_get(project_id, comment_thread_id, access_token, &context).await
    }

    /// cors helper
    async fn project_project_id_code_comment_comment_thread_id_options(
        &self,
        project_id: String,
        comment_thread_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdCodeCommentCommentThreadIdOptionsResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().project_project_id_code_comment_comment_thread_id_options(project_id, comment_thread_id, access_token, &context).await
    }

    /// 新增代码评论
    async fn project_project_id_code_comment_comment_thread_id_put(
        &self,
        project_id: String,
        comment_thread_id: String,
        access_token: String,
        project_project_id_code_comment_comment_thread_id_put_request: Option<models::ProjectProjectIdCodeCommentCommentThreadIdPutRequest>,
        ) -> Result<ProjectProjectIdCodeCommentCommentThreadIdPutResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().project_project_id_code_comment_comment_thread_id_put(project_id, comment_thread_id, access_token, project_project_id_code_comment_comment_thread_id_put_request, &context).await
    }

    /// 列出内容目录和入口
    async fn project_project_id_entry_folder_id_get(
        &self,
        project_id: String,
        folder_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdEntryFolderIdGetResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().project_project_id_entry_folder_id_get(project_id, folder_id, access_token, &context).await
    }

    /// 打开内容入口
    async fn project_project_id_entry_show_entry_id_get(
        &self,
        project_id: String,
        entry_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdEntryShowEntryIdGetResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().project_project_id_entry_show_entry_id_get(project_id, entry_id, access_token, &context).await
    }

    /// 事件列表
    async fn project_project_id_event_get(
        &self,
        project_id: String,
        from_time: i64,
        to_time: i64,
        offset: i32,
        limit: i32,
        access_token: String,
        user_id: Option<String>,
        ) -> Result<ProjectProjectIdEventGetResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().project_project_id_event_get(project_id, from_time, to_time, offset, limit, access_token, user_id, &context).await
    }

    /// cors helper
    async fn project_project_id_event_options(
        &self,
        project_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdEventOptionsResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().project_project_id_event_options(project_id, access_token, &context).await
    }

    /// 上报自定义事件
    async fn project_project_id_event_post(
        &self,
        project_id: String,
        access_token: String,
        project_project_id_event_post_request: Option<models::ProjectProjectIdEventPostRequest>,
        ) -> Result<ProjectProjectIdEventPostResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().project_project_id_event_post(project_id, access_token, project_project_id_event_post_request, &context).await
    }

    /// 所有任务
    async fn project_project_id_task_all_get(
        &self,
        project_id: String,
        offset: i32,
        limit: i32,
        access_token: String,
        ) -> Result<ProjectProjectIdTaskAllGetResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().project_project_id_task_all_get(project_id, offset, limit, access_token, &context).await
    }

    /// 指派给我的任务
    async fn project_project_id_task_my_get(
        &self,
        project_id: String,
        state: String,
        access_token: String,
        ) -> Result<ProjectProjectIdTaskMyGetResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().project_project_id_task_my_get(project_id, state, access_token, &context).await
    }

    /// 列出依赖工单
    async fn project_project_id_task_record_task_id_depend_get(
        &self,
        project_id: String,
        task_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdTaskRecordTaskIdDependGetResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().project_project_id_task_record_task_id_depend_get(project_id, task_id, access_token, &context).await
    }

    /// 任务相关事件
    async fn project_project_id_task_record_task_id_events_get(
        &self,
        project_id: String,
        task_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdTaskRecordTaskIdEventsGetResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().project_project_id_task_record_task_id_events_get(project_id, task_id, access_token, &context).await
    }

    /// 便签方式显示任务
    async fn project_project_id_task_record_task_id_short_note_get(
        &self,
        project_id: String,
        task_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdTaskRecordTaskIdShortNoteGetResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().project_project_id_task_record_task_id_short_note_get(project_id, task_id, access_token, &context).await
    }

    /// 显示任务
    async fn project_project_id_task_record_task_id_show_get(
        &self,
        project_id: String,
        task_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdTaskRecordTaskIdShowGetResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().project_project_id_task_record_task_id_show_get(project_id, task_id, access_token, &context).await
    }

    /// 列出子任务
    async fn project_project_id_task_record_task_id_sub_task_get(
        &self,
        project_id: String,
        task_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdTaskRecordTaskIdSubTaskGetResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().project_project_id_task_record_task_id_sub_task_get(project_id, task_id, access_token, &context).await
    }

    /// git post commit hook回调
    async fn project_project_id_tools_post_hook_get(
        &self,
        project_id: String,
        access_token: String,
        ) -> Result<ProjectProjectIdToolsPostHookGetResponse, ApiError>
    {
        let context = self.context().clone();
        self.api().project_project_id_tools_post_hook_get(project_id, access_token, &context).await
    }

}


#[cfg(feature = "client")]
pub mod client;

// Re-export Client as a top-level name
#[cfg(feature = "client")]
pub use client::Client;

#[cfg(feature = "server")]
pub mod server;

// Re-export router() as a top-level name
#[cfg(feature = "server")]
pub use self::server::Service;

#[cfg(feature = "server")]
pub mod context;

pub mod models;

#[cfg(any(feature = "client", feature = "server"))]
pub(crate) mod header;
